package com.example.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 地址
 *
 * Created by wj on 17-6-30.
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Embeddable
public class Address implements Serializable {

    //城市
    @NotNull
    @Column(nullable = false)
    private String city;

    //街道
    @NotNull
    @Column(nullable = false)
    private String street;

    //邮政编码
    @NotNull
    @Column(nullable = false,length = 6)
    private String zipCode;

}
